package com.authsphere.plugin.api;

/**
 * @program: AuthSphere
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/25 11:08
 **/
public interface AuthSphereAfterPlugin extends AuthSpherePlugin<AuthSphereAfterPluginChain> {

//    /**
//     * Process the Before Authentication  and (optionally) delegate to the next
//     * @param context WebExchange
//     * @param chain AuthSphereAfterPluginChain
//     */
//    void execute(WebExchange context, AuthSphereAfterPluginChain chain);

    /**
     * plugin is executed
     *
     * @param context WebExchange
     * @return default false
     */
    default boolean skip(WebExchange context) {
        return false;
    }

    /**
     * 是否终止执行
     * @param exchange WebExchange
     * @return is abort
     */
    default boolean abort(WebExchange exchange) {
        return exchange.isAbort();
    }

    default String name() {
        return "";
    }
}
